﻿


using System;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.Serialization;

namespace UFIDA.U9.Cust.SH.SHFastShipSV
{
	/// <summary>
	/// 快速出货单行 DTO :自定义的数据传输类型 
	/// 
	/// </summary>
	public  partial class FastShipLineDTO  : UFSoft.UBF.Business.DTOBase
	{
		#region Constructor
		
		/// <summary>
		/// Constructor
		/// </summary>
		public FastShipLineDTO(){
			initData();
		}
		private void initData()
		{
		
					DocLineNo = 0; 
		
					Qty = 0m; 
		
		
		
					OrderQty = 0m; 
					SalePrice = 0m; 
		
		

		}

		#endregion
		
		#region Properties
			/// <summary>
		/// 快速出货单头 (该属性可为空,且无默认值)
		/// 快速出货单行.Misc.快速出货单头
		/// </summary>
		/// <value>UFIDA.U9.Cust.SH.SHFastShipSV.FastShipDTO</value>
		public UFIDA.U9.Cust.SH.SHFastShipSV.FastShipDTO FastShipDTO
		{
			get	
			{	
				return (UFIDA.U9.Cust.SH.SHFastShipSV.FastShipDTO)base.GetValue("FastShipDTO",typeof(UFIDA.U9.Cust.SH.SHFastShipSV.FastShipDTO));
			}

			 set	
			{
				base.SetValue("FastShipDTO",value);
			}
		}
				/// <summary>
		/// 行号 (该属性可为空,但有默认值)
		/// 快速出货单行.Misc.行号
		/// </summary>
		/// <value>System.Int32</value>
		public System.Int32 DocLineNo
		{
			get	
			{	
				return (System.Int32)base.GetValue("DocLineNo",typeof(System.Int32));
			}

			 set	
			{
				base.SetValue("DocLineNo",value);
			}
		}
				/// <summary>
		/// 料品 (该属性可为空,且无默认值)
		/// 快速出货单行.Misc.料品
		/// </summary>
		/// <value>UFIDA.U9.CBO.SCM.Item.ItemMaster</value>
		public UFIDA.U9.CBO.SCM.Item.ItemMaster Item
		{
			get	
			{	
				return (UFIDA.U9.CBO.SCM.Item.ItemMaster)base.GetValue("Item",typeof(UFIDA.U9.CBO.SCM.Item.ItemMaster));
			}

			 set	
			{
				base.SetValue("Item",value);
			}
		}
				/// <summary>
		/// 数量 (该属性可为空,但有默认值)
		/// 快速出货单行.Misc.数量
		/// </summary>
		/// <value>System.Decimal</value>
		public System.Decimal Qty
		{
			get	
			{	
				return (System.Decimal)base.GetValue("Qty",typeof(System.Decimal));
			}

			 set	
			{
				base.SetValue("Qty",value);
			}
		}
				/// <summary>
		/// 单位 (该属性可为空,且无默认值)
		/// 快速出货单行.Misc.单位
		/// </summary>
		/// <value>UFIDA.U9.Base.UOM.UOM</value>
		public UFIDA.U9.Base.UOM.UOM UOM
		{
			get	
			{	
				return (UFIDA.U9.Base.UOM.UOM)base.GetValue("UOM",typeof(UFIDA.U9.Base.UOM.UOM));
			}

			 set	
			{
				base.SetValue("UOM",value);
			}
		}
				/// <summary>
		/// 仓库 (该属性可为空,且无默认值)
		/// 快速出货单行.Misc.仓库
		/// </summary>
		/// <value>UFIDA.U9.CBO.SCM.Warehouse.Warehouse</value>
		public UFIDA.U9.CBO.SCM.Warehouse.Warehouse WH
		{
			get	
			{	
				return (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)base.GetValue("WH",typeof(UFIDA.U9.CBO.SCM.Warehouse.Warehouse));
			}

			 set	
			{
				base.SetValue("WH",value);
			}
		}
				/// <summary>
		/// 备注 (该属性可为空,且无默认值)
		/// 快速出货单行.Misc.备注
		/// </summary>
		/// <value>System.String</value>
		public System.String Memo
		{
			get	
			{	
				return (System.String)base.GetValue("Memo",typeof(System.String));
			}

			 set	
			{
				base.SetValue("Memo",value);
			}
		}
				/// <summary>
		/// 订货数量 (该属性可为空,但有默认值)
		/// 快速出货单行.Misc.订货数量
		/// </summary>
		/// <value>System.Decimal</value>
		public System.Decimal OrderQty
		{
			get	
			{	
				return (System.Decimal)base.GetValue("OrderQty",typeof(System.Decimal));
			}

			 set	
			{
				base.SetValue("OrderQty",value);
			}
		}
				/// <summary>
		/// 销售价 (该属性可为空,但有默认值)
		/// 快速出货单行.Misc.销售价
		/// </summary>
		/// <value>System.Decimal</value>
		public System.Decimal SalePrice
		{
			get	
			{	
				return (System.Decimal)base.GetValue("SalePrice",typeof(System.Decimal));
			}

			 set	
			{
				base.SetValue("SalePrice",value);
			}
		}
				/// <summary>
		/// 组合料号 (该属性可为空,且无默认值)
		/// 快速出货单行.Misc.组合料号
		/// </summary>
		/// <value>System.String</value>
		public System.String MDItemCode
		{
			get	
			{	
				return (System.String)base.GetValue("MDItemCode",typeof(System.String));
			}

			 set	
			{
				base.SetValue("MDItemCode",value);
			}
		}
				/// <summary>
		/// 门店订单明细ID (该属性可为空,且无默认值)
		/// 快速出货单行.Misc.门店订单明细ID
		/// </summary>
		/// <value>System.String</value>
		public System.String MDLineID
		{
			get	
			{	
				return (System.String)base.GetValue("MDLineID",typeof(System.String));
			}

			 set	
			{
				base.SetValue("MDLineID",value);
			}
		}
		
		#endregion	
		#region Multi_Fields
											
		#endregion 

		#region ModelResource
		/// <summary>
		/// 快速出货单行的显示名称资源--已经废弃，不使用.
		/// </summary>
		public string Res_TypeName {	get {return "" ;}	}
		/// <summary>
		/// 快速出货单头的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_FastShipDTO　{ get { return "";　}　}
		/// <summary>
		/// 行号的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_DocLineNo　{ get { return "";　}　}
		/// <summary>
		/// 料品的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Item　{ get { return "";　}　}
		/// <summary>
		/// 数量的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Qty　{ get { return "";　}　}
		/// <summary>
		/// 单位的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_UOM　{ get { return "";　}　}
		/// <summary>
		/// 仓库的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_WH　{ get { return "";　}　}
		/// <summary>
		/// 备注的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_Memo　{ get { return "";　}　}
		/// <summary>
		/// 订货数量的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_OrderQty　{ get { return "";　}　}
		/// <summary>
		/// 销售价的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_SalePrice　{ get { return "";　}　}
		/// <summary>
		/// 组合料号的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_MDItemCode　{ get { return "";　}　}
		/// <summary>
		/// 门店订单明细ID的显示名称资源 -- 已经废弃，不使用.
		/// </summary>
		public string Res_MDLineID　{ get { return "";　}　}
		#endregion 




		#region EntityData exchange
		
		#region  Do SerializeKey -ForDTOType
		//反序化Key到Data的ID中　－－由FromEntityData自动调用，不处理层次关系
		private void DeSerializeKey(FastShipLineDTOData data)
		{
		











		}

		#endregion 
		
		/// <summary>
		/// Copy Entity From EntityData
		/// </summary>
		public void FromEntityData(FastShipLineDTOData data)
		{
			this.FromEntityData(data,new Hashtable());
		}
		//used by ubf..
		public void FromEntityData(FastShipLineDTOData data,IDictionary dict)
		{
			if (data == null)
				return;
			if (dict == null ) dict = new Hashtable() ;
			dict[data] = this;
			DeSerializeKey(data);
		
			if (data.FastShipDTO!=null)
			{
				UFIDA.U9.Cust.SH.SHFastShipSV.FastShipDTO temp = dict[data.FastShipDTO] as UFIDA.U9.Cust.SH.SHFastShipSV.FastShipDTO ;
				if (temp == null)
				{
					temp = new UFIDA.U9.Cust.SH.SHFastShipSV.FastShipDTO();
					temp.FromEntityData(data.FastShipDTO,dict);
				}
				this.FastShipDTO = temp ;
			}
		

			this.DocLineNo = data.DocLineNo;

			{
			if (data.Item!=null)
			{
				UFIDA.U9.CBO.SCM.Item.ItemMaster child = dict[data.Item] as UFIDA.U9.CBO.SCM.Item.ItemMaster ;
				if (child == null)
				{
					if (data.Item.ID>0)
					{
						if (data.Item.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.CBO.SCM.Item.ItemMaster)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.Item.ID,data.Item.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.CBO.SCM.Item.ItemMaster)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Item.SysEntityType,null,data.Item.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.CBO.SCM.Item.ItemMaster)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.Item.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.Item, dict);
				}
				this.Item = child ;
			}
			else
				this.Item = null ;
			}

			this.Qty = data.Qty;

			{
			if (data.UOM!=null)
			{
				UFIDA.U9.Base.UOM.UOM child = dict[data.UOM] as UFIDA.U9.Base.UOM.UOM ;
				if (child == null)
				{
					if (data.UOM.ID>0)
					{
						if (data.UOM.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.Base.UOM.UOM)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.UOM.ID,data.UOM.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.Base.UOM.UOM)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.UOM.SysEntityType,null,data.UOM.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.Base.UOM.UOM)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.UOM.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.UOM, dict);
				}
				this.UOM = child ;
			}
			else
				this.UOM = null ;
			}

			{
			if (data.WH!=null)
			{
				UFIDA.U9.CBO.SCM.Warehouse.Warehouse child = dict[data.WH] as UFIDA.U9.CBO.SCM.Warehouse.Warehouse ;
				if (child == null)
				{
					if (data.WH.ID>0)
					{
						if (data.WH.SysState != UFSoft.UBF.PL.Engine.ObjectState.Inserted)
							child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)(new UFSoft.UBF.Business.BusinessEntity.EntityKey(data.WH.ID,data.WH.SysEntityType).GetEntity());
						if (child==null) child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.WH.SysEntityType,null,data.WH.ID,true) ;
					}
					else
					{
 						child = (UFIDA.U9.CBO.SCM.Warehouse.Warehouse)UFSoft.UBF.Business.Entity.CreateTransientObjWithKey(data.WH.SysEntityType,null,null,true) ;				
 					}
					
					child.FromEntityData(data.WH, dict);
				}
				this.WH = child ;
			}
			else
				this.WH = null ;
			}

			this.Memo = data.Memo;

			this.OrderQty = data.OrderQty;

			this.SalePrice = data.SalePrice;

			this.MDItemCode = data.MDItemCode;

			this.MDLineID = data.MDLineID;

		}

		/// <summary>
		/// Create EntityData From Entity
		/// </summary>
		public FastShipLineDTOData ToEntityData()
		{
			return ToEntityData(null,new Hashtable());
		}
		/// <summary>
		/// Create EntityData From Entity - used by ubf 
		/// </summary>
		public FastShipLineDTOData ToEntityData(FastShipLineDTOData data, IDictionary dict){
			if (data == null)
				data = new FastShipLineDTOData();
			if (dict == null ) 
				dict = new Hashtable() ;
			else
            {
                if (dict.Contains(this))
                {
                    data = (FastShipLineDTOData)dict[this];
                    return data;
                }
            }
			dict[this] = data;
		
			if (this.FastShipDTO!=null)
			{
				data.FastShipDTO=this.FastShipDTO.ToEntityData(null,dict);
			}
		

			data.DocLineNo = this.DocLineNo;

			if (this.Item!=null)
			{
				data.Item=this.Item.ToEntityData(null,dict);
			}

			data.Qty = this.Qty;

			if (this.UOM!=null)
			{
				data.UOM=this.UOM.ToEntityData(null,dict);
			}

			if (this.WH!=null)
			{
				data.WH=this.WH.ToEntityData(null,dict);
			}

			data.Memo = this.Memo;

			data.OrderQty = this.OrderQty;

			data.SalePrice = this.SalePrice;

			data.MDItemCode = this.MDItemCode;

			data.MDLineID = this.MDLineID;

			return data ;
		}

		#endregion	
	}	
	
}